inherited FrmEntSaiProdutoRel: TFrmEntSaiProdutoRel
  Left = 262
  Top = 268
  Caption = 'Relat'#243'rio de Entradas e Sa'#237'das por Produto'
  ClientHeight = 257
  ClientWidth = 447
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  inherited pnlOpcoes: TPanel
    Width = 447
    Height = 172
    object Label2: TLabel
      Left = 14
      Top = 7
      Width = 41
      Height = 13
      Caption = 'Empresa'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object LblTipoRelatorio: TLabel
      Left = 14
      Top = 48
      Width = 54
      Height = 13
      Caption = 'Buscar por:'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label6: TLabel
      Left = 121
      Top = 49
      Width = 42
      Height = 13
      Caption = 'Situa'#231#227'o'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object Label1: TLabel
      Left = 14
      Top = 88
      Width = 73
      Height = 13
      Caption = 'C'#243'digo / Serial:'
    end
    object Label3: TLabel
      Left = 199
      Top = 88
      Width = 88
      Height = 13
      Caption = 'C'#243'digo do Produto'
    end
    object Label4: TLabel
      Left = 320
      Top = 88
      Width = 81
      Height = 13
      Caption = 'C'#243'digo de Barras'
    end
    object Label5: TLabel
      Left = 14
      Top = 129
      Width = 103
      Height = 13
      Caption = 'Descri'#231#227'o do Produto'
    end
    object EdtEstEmpCod: TEdit
      Left = 14
      Top = 20
      Width = 49
      Height = 21
      Hint = 'C'#243'digo da empresa'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 0
      OnExit = EdtEstEmpCodExit
    end
    object BtnEmpresa: TBitBtn
      Left = 63
      Top = 20
      Width = 22
      Height = 22
      Hint = 'Buscar empresa'
      Caption = '...'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 1
      TabStop = False
      OnClick = BtnEmpresaClick
    end
    object EdtEstEmpNom: TEdit
      Left = 85
      Top = 20
      Width = 348
      Height = 21
      TabStop = False
      CharCase = ecUpperCase
      Color = clBtnFace
      Font.Charset = ANSI_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
      ReadOnly = True
      TabOrder = 2
    end
    object CB_BuscarPor: TComboBox
      Left = 14
      Top = 60
      Width = 99
      Height = 21
      Hint = 'Tipo de busca'
      Style = csDropDownList
      ItemHeight = 13
      ItemIndex = 1
      ParentShowHint = False
      ShowHint = True
      TabOrder = 3
      Text = 'C'#211'DIGO'
      OnChange = CB_BuscarPorChange
      Items.Strings = (
        'SERIAL'
        'C'#211'DIGO')
    end
    object CB_TipoRel: TComboBox
      Left = 120
      Top = 62
      Width = 118
      Height = 21
      Hint = 'Situa'#231#227'o dos itens'
      Style = csDropDownList
      ItemHeight = 13
      ItemIndex = 0
      ParentShowHint = False
      ShowHint = True
      TabOrder = 4
      Text = 'N'#227'o Cancelados'
      OnChange = CB_TipoRelChange
      Items.Strings = (
        'N'#227'o Cancelados'
        'Cancelados')
    end
    object edt_Cod_Serial: TEdit
      Left = 14
      Top = 101
      Width = 138
      Height = 21
      Hint = 'Serial'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 5
      OnExit = edt_Cod_SerialExit
    end
    object BtnProduto: TBitBtn
      Left = 153
      Top = 101
      Width = 22
      Height = 22
      Hint = 'Buscar produto'
      Caption = '...'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 6
      TabStop = False
      OnClick = BtnProdutoClick
    end
    object STCodProduto: TStaticText
      Left = 199
      Top = 101
      Width = 113
      Height = 19
      AutoSize = False
      BorderStyle = sbsSingle
      Color = clBtnFace
      ParentColor = False
      ParentShowHint = False
      ShowHint = False
      TabOrder = 7
    end
    object STCodBarras: TStaticText
      Left = 320
      Top = 101
      Width = 113
      Height = 19
      AutoSize = False
      BorderStyle = sbsSingle
      Color = clBtnFace
      ParentColor = False
      TabOrder = 8
    end
    object STDescProduto: TStaticText
      Left = 14
      Top = 142
      Width = 418
      Height = 19
      AutoSize = False
      BorderStyle = sbsSingle
      Color = clBtnFace
      ParentColor = False
      TabOrder = 9
    end
  end
  inherited pnlBotoes: TPanel
    Top = 213
    Width = 447
  end
  inherited pnlCabecalho: TPanel
    Width = 447
    Caption = 'Entradas e Sa'#237'das por Produtos'
  end
  inherited RvProjectModelo: TRvProject
    Left = 288
    Top = 65
  end
  inherited sql_dataset_principal: TSQLClientDataSet
    Left = 184
    Top = 65
  end
  inherited rds_dataset_principal: TRvDataSetConnection
    Left = 16
    Top = 1
  end
  inherited RvRenderPDF1: TRvRenderPDF
    Left = 312
    Top = 1
  end
  inherited SaveDialog1: TSaveDialog
    Left = 352
    Top = 1
  end
  inherited RvSystemPDF: TRvSystem
    Left = 384
    Top = 81
  end
  object SQL_ES_Saidas: TSQLClientDataSet
    CommandText = 
      'SELECT SI.SAI_IDFDOC , SI.SAI_CANCEL, SD.SAD_DOCUME DOCUMENTO, S' +
      'I.SAI_QUANTI QUANTIDADE, SD.SAD_CODVEN CODVEN, SD.SAD_CODCFO COD' +
      'CFO,'#13#10'SD.SAD_ORCAME ORCAMENTO, SD.SAD_DATAVE EMISSAO,'#13#10'SD.SAD_CO' +
      'DCAI CAIXA, SD.SAD_IDFEMPRESA COD_EMPRESA,'#13#10' EMP.EMP_RAZSOC RAZA' +
      'O_SOCIAL, SI.SAI_SERIAL SERIAL,'#13#10' U.USU_NOME VENDEDOR, SI.SAI_PR' +
      'ETAB PRECO_TABELA, SI.SAI_PREVEN PRECO_VENDA,'#13#10' SI.SAI_CODHISTOR' +
      'ICO COD_HISTORICO, HIS.HIS_HISTORICO HISTORICO,'#13#10'(SI.SAI_PREVEN ' +
      '* SI.SAI_QUANTI) AS TOT_VENDA'#13#10'FROM SAIDA_ITEM SI'#13#10'INNER JOIN SA' +
      'IDA_DOCUMENTO SD ON SD.SAD_IDFDOC = SI.SAI_IDFDOC'#13#10'INNER JOIN EM' +
      'PRESAS EMP ON EMP.EMP_CODIGO = SAD_IDFEMPRESA'#13#10'INNER JOIN USUARI' +
      'OS U ON U.USU_CODIGO = SAD_CODVEN'#13#10'LEFT OUTER JOIN HISTORICOS HI' +
      'S ON HIS.HIS_IDFCOD = SAI_CODHISTORICO'#13#10'WHERE SAI_SERIAL = :SERI' +
      'AL'#13#10
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftString
        Name = 'SERIAL'
        ParamType = ptInput
      end>
    AfterOpen = SQL_ES_SaidasAfterOpen
    DBConnection = DtmGeral.ConexaoBanco
    Left = 216
    Top = 2
    object SQL_ES_SaidasSAI_IDFDOC: TIntegerField
      FieldName = 'SAI_IDFDOC'
      Required = True
    end
    object SQL_ES_SaidasSAI_CANCEL: TStringField
      FieldName = 'SAI_CANCEL'
      Required = True
      FixedChar = True
      Size = 1
    end
    object SQL_ES_SaidasDOCUMENTO: TStringField
      FieldName = 'DOCUMENTO'
      Required = True
      Size = 13
    end
    object SQL_ES_SaidasQUANTIDADE: TFMTBCDField
      FieldName = 'QUANTIDADE'
      Required = True
      Precision = 15
      Size = 3
    end
    object SQL_ES_SaidasCODVEN: TStringField
      FieldName = 'CODVEN'
      Required = True
      Size = 3
    end
    object SQL_ES_SaidasCODCFO: TStringField
      FieldName = 'CODCFO'
      Size = 8
    end
    object SQL_ES_SaidasORCAMENTO: TStringField
      FieldName = 'ORCAMENTO'
      Size = 13
    end
    object SQL_ES_SaidasEMISSAO: TDateField
      FieldName = 'EMISSAO'
      Required = True
    end
    object SQL_ES_SaidasCAIXA: TSmallintField
      FieldName = 'CAIXA'
      Required = True
    end
    object SQL_ES_SaidasCOD_EMPRESA: TSmallintField
      FieldName = 'COD_EMPRESA'
      Required = True
    end
    object SQL_ES_SaidasRAZAO_SOCIAL: TStringField
      FieldName = 'RAZAO_SOCIAL'
      Required = True
      Size = 60
    end
    object SQL_ES_SaidasSERIAL: TStringField
      FieldName = 'SERIAL'
    end
    object SQL_ES_SaidasVENDEDOR: TStringField
      FieldName = 'VENDEDOR'
      Required = True
      Size = 60
    end
    object SQL_ES_SaidasPRECO_TABELA: TFMTBCDField
      FieldName = 'PRECO_TABELA'
      Required = True
      Precision = 15
      Size = 3
    end
    object SQL_ES_SaidasPRECO_VENDA: TFMTBCDField
      FieldName = 'PRECO_VENDA'
      Required = True
      Precision = 15
      Size = 3
    end
    object SQL_ES_SaidasCOD_HISTORICO: TStringField
      FieldName = 'COD_HISTORICO'
      Size = 3
    end
    object SQL_ES_SaidasHISTORICO: TStringField
      FieldName = 'HISTORICO'
      Size = 40
    end
    object SQL_ES_SaidasTOT_VENDA: TFMTBCDField
      FieldName = 'TOT_VENDA'
      Required = True
      Precision = 15
      Size = 6
    end
  end
  object SQL_ES_Entradas: TSQLClientDataSet
    CommandText = 
      'select ENS.ENS_IDFDOCUMENTO IDFDOCUMENTO, ENS.ENS_SERIAL SERIAL,' +
      #13#10'ENS.ENS_QUANTIDADE QUANTIDADE,ENS.ENS_CANCELADO CANCELADO,ENP.' +
      'ENP_SEQITEMDOCUM,'#13#10'ED.END_DATAENTRADA DATA_ENTRADA, ED.END_DATAE' +
      'MISSAO DATA_EMISSAO,'#13#10'ED.END_DOCUMENTO Documento, ED.END_CFOPCOD' +
      'IGO CODCFO, PE.PES_NOME FORNECEDOR,'#13#10'END_EMPRESACODIGO CODEMPRES' +
      'A, EMP_RAZSOC EMPRESA, ED.END_PESSOAIDF COD_FORNECEDOR,'#13#10'ENP_PRE' +
      'COCOMPRA PRECO_COMPRA, ENP_PRECOCUSTO PRECO_CUSTO,'#13#10'(ENP_PRECOCO' +
      'MPRA * ENS_QUANTIDADE) AS TOT_COMPRA, '#13#10'(ENP_PRECOCUSTO  * ENS_Q' +
      'UANTIDADE) AS TOT_CUSTO '#13#10'from ENTRADA_SERIAL ENS'#13#10'inner join EN' +
      'TRADA_DOCUMENTO ED on ED.END_IDFDOCUMENTO = ENS.ENS_IDFDOCUMENTO' +
      #13#10'inner join EMPRESAS em on em.EMP_CODIGO = ED.END_EMPRESACODIGO' +
      #13#10'inner join PESSOAS PE  on PE.PES_IDFCOD = ED.END_PESSOAIDF'#13#10'in' +
      'ner join ENTRADA_PRODUTOS ENP on (END_IDFDOCUMENTO=ENP_IDFDOCUME' +
      'NTO and ENS_IDFITEMDOCUM=ENP_SEQITEMDOCUM)'#13#10'WHERE ENS.ENS_SERIAL' +
      ' = :SERIAL'#13#10
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftString
        Name = 'SERIAL'
        ParamType = ptInput
      end>
    AfterOpen = SQL_ES_EntradasAfterOpen
    DBConnection = DtmGeral.ConexaoBanco
    Left = 272
    Top = 2
    object SQL_ES_EntradasIDFDOCUMENTO: TIntegerField
      FieldName = 'IDFDOCUMENTO'
      Required = True
    end
    object SQL_ES_EntradasSERIAL: TStringField
      FieldName = 'SERIAL'
      Required = True
    end
    object SQL_ES_EntradasQUANTIDADE: TFMTBCDField
      FieldName = 'QUANTIDADE'
      Required = True
      Precision = 15
      Size = 3
    end
    object SQL_ES_EntradasCANCELADO: TStringField
      FieldName = 'CANCELADO'
      Required = True
      FixedChar = True
      Size = 1
    end
    object SQL_ES_EntradasENP_SEQITEMDOCUM: TSmallintField
      FieldName = 'ENP_SEQITEMDOCUM'
      Required = True
    end
    object SQL_ES_EntradasDATA_ENTRADA: TDateField
      FieldName = 'DATA_ENTRADA'
      Required = True
    end
    object SQL_ES_EntradasDATA_EMISSAO: TDateField
      FieldName = 'DATA_EMISSAO'
      Required = True
    end
    object SQL_ES_EntradasDOCUMENTO: TStringField
      FieldName = 'DOCUMENTO'
      Required = True
      Size = 13
    end
    object SQL_ES_EntradasCODCFO: TStringField
      FieldName = 'CODCFO'
      Required = True
      Size = 8
    end
    object SQL_ES_EntradasFORNECEDOR: TStringField
      FieldName = 'FORNECEDOR'
      Required = True
      Size = 60
    end
    object SQL_ES_EntradasCODEMPRESA: TSmallintField
      FieldName = 'CODEMPRESA'
      Required = True
    end
    object SQL_ES_EntradasEMPRESA: TStringField
      FieldName = 'EMPRESA'
      Required = True
      Size = 60
    end
    object SQL_ES_EntradasCOD_FORNECEDOR: TIntegerField
      FieldName = 'COD_FORNECEDOR'
      Required = True
    end
    object SQL_ES_EntradasPRECO_COMPRA: TFMTBCDField
      FieldName = 'PRECO_COMPRA'
      Precision = 15
      Size = 3
    end
    object SQL_ES_EntradasPRECO_CUSTO: TFMTBCDField
      FieldName = 'PRECO_CUSTO'
      Precision = 15
      Size = 3
    end
    object SQL_ES_EntradasTOT_COMPRA: TFMTBCDField
      FieldName = 'TOT_COMPRA'
      Precision = 15
      Size = 6
    end
    object SQL_ES_EntradasTOT_CUSTO: TFMTBCDField
      FieldName = 'TOT_CUSTO'
      Precision = 15
      Size = 6
    end
  end
  object rds_saida: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQL_ES_Saidas
    Left = 104
    Top = 10
  end
  object rds_entrada: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQL_ES_Entradas
    Left = 112
    Top = 66
  end
end
